import type { AppRouteModule } from '@/router/types'
import { RoleEnum } from '@/enums/roleEnum'

const dashboard: AppRouteModule = {
  path: '/dashboard',
  name: 'Dashboard',
  meta: {
    type: 'menu',
    title: 'Dashboard',
    icon: 'menu'
  },
  component: () => import(/* webpackChunkName: "empty" */ '@/layout/cnps/empty/empty.vue'),
  children: [
    {
      path: 'analysis',
      name: 'Analysis',
      component: () =>
        import(/* webpackChunkName: "analysis" */ '@/views/dashboard/analysis/index.vue'),
      meta: {
        // 路由title  一般必填
        title: '分析页',
        // 可以访问的角色，只在权限模式为Role的时候有效
        roles: [RoleEnum.SUPER],
        // 当前路由不再菜单显示
        hideMenu: false,
        // 固定标签
        affix: true
      }
    },
    {
      path: 'workbench',
      name: 'Workbench',
      meta: {
        title: '工作台',
        icon: ''
      },
      component: () =>
        import(/* webpackChunkName: "workbench" */ '@/views/dashboard/workbench/index.vue')
    }
  ]
}

export default dashboard
